package top.zhongyy.pojo;

import com.baomidou.mybatisplus.annotation.*;

import java.util.ArrayList;
import java.util.Date;
import java.io.Serializable;
import java.util.List;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

/**
 * <p>
 *
 * </p>
 *
 * @author Andy
 * @since 2021-03-25
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value = "Comment对象", description = "")
@TableName(value = "t_comment")
public class Comment implements Serializable {
    
    private static final long serialVersionUID = 1L;
    
    @ApiModelProperty(value = "评论id")
    @TableId(value = "id", type = IdType.ID_WORKER)
    private Long id;
    
    @ApiModelProperty(value = "头像")
    private String avatar;
    
    @ApiModelProperty(value = "评论内容")
    private String content;
    
    @ApiModelProperty(value = "创建时间")
    @TableField(fill = FieldFill.INSERT)
    private Date createTime;
    
    @ApiModelProperty(value = "邮箱")
    private String email;
    
    @ApiModelProperty(value = "昵称")
    private String nickname;
    
    @ApiModelProperty(value = "博客id")
    private Long blogId;
    
    @ApiModelProperty(value = "父评论id")
    private Long parentCommentId;
    
    @ApiModelProperty(value = "是否管理员评论")
    private boolean adminComment;
    
    @ApiModelProperty(value = "逻辑删除")
    @TableLogic
    private int deleted;
    
    @ApiModelProperty(value = "该评论下的所有评论集合")
    @TableField(exist = false)
    private List<Comment> replyComments = new ArrayList<>();
    
    @ApiModelProperty(value = "该评论的父评论")
    @TableField(exist = false)
    private String parentCommentName;
    
    
}
